package com.qingcheng.dao;

import com.qingcheng.pojo.goods.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface BrandMapper extends Mapper<Brand> {
    @Select("SELECT tb.name,tb.image FROM tb_brand tb," +
            " (SELECT tcb.brand_id FROM" +
            " tb_category_brand tcb,tb_category tc " +
            " WHERE tc.id=tcb.category_id AND tc.name=#{categoryName}) tr" +
            " WHERE tb.id=tr.brand_id")
    public List<Map> findListByCategoryName(@Param("categoryName") String categoryName);
}
